from Base import message, intersect, SS_VALID
from DRG import MDCD_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["01.1200x001","02.1200x002","02.1200x003","02.1201","02.1202","02.1203","02.1204","02.1208","02.1209","03.5100x003","04.0205","04.0300x013","04.0302","04.0403","04.0700x030","04.0700x032","04.0700x033","04.0700x034","04.4201","04.4202","05.2100","05.2100x002","07.1400","07.6200x003","07.6200x007","07.6201","07.6202","07.6500","07.6501","07.7200x002","07.7201","07.7202","07.7203","09.6x02","16.0904","16.8902","21.0500","22.4200x007","76.7802"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合DB2入组条件，匹配规则：主手术匹配')

    if MDCD_DRG.DB29_group(record):
      return 'DB29'
        
    return 'DB2'
  else:
    return ''
    
